import QtQuick 1.0
import com.nokia.symbian 1.0
import "../js/Storage.js" as Storage
import "../delegate"

PurePage {
    id: sessionTypePage

    anchors { fill: parent; topMargin: statusBar.height; bottomMargin: toolBar.height }
    signal downloadType
    signal sessionType(int listIndex)
    signal reloadType

    ListModel {
        id: sessionModel
    }

    LodingIndicator {
        id: lodingSessionPage
    }

    ListView {
        id: sessionTypeListView

        anchors { fill: parent}
        cacheBuffer: 2 * height
        delegate: SessionTypeDelegate {}
        model: sessionModel
    }

    ScrollBar {
        flickableItem: sessionTypeListView
        anchors { right: sessionTypeListView.right; top: sessionTypeListView.top }
    }

    onDownloadType: {
            sessionModel.clear();
            Storage.getTypeCache(sessionModel);
    }

}
